﻿using Abp.AutoMapper;
using Abp.Dependency;
using Abp.Modules;
using GN.Pay.Core.Runtime.Caching;
using GN.Pay.Core.Runtime.Caching.Impl;
using GN.Pay.Core.Services;
using GN.Pay.Core.Tasks.Queue;
using System.Reflection;
using static GN.Pay.Core.Consts;

namespace GN.Pay.Core
{
    /// <summary>
    /// 核心模块
    /// </summary>
    [DependsOn(typeof(AbpAutoMapperModule))]
    public class CoreModule : AbpModule
    {

        /// <summary>
        /// 
        /// </summary>
        public override void PreInitialize()
        {
            base.PreInitialize();
            IocManager.Register<IBaseCache, RedisBaseCache>(DependencyLifeStyle.Transient);
        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
            IocManagerUtils.IocManager = IocManager;
            System.Threading.ThreadPool.SetMinThreads(500, 300);            
        }
    }
}
